package kr.ac.inha.vota;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.Menu;

public class VoicememosActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_voicememos);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_voicememos, menu);
        return true;
    }
    
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    	if(event.getAction() == KeyEvent.ACTION_DOWN) {
    		if(keyCode == KeyEvent.KEYCODE_BACK) {
    			Intent intent = new Intent(VoicememosActivity.this, MainActivity.class);
    			intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        		startActivity(intent);
        		finish();
        		
        		return false;
    		}
    	}
    	
    	// TODO Auto-generated method stub
    	return super.onKeyDown(keyCode, event);
    }
}
